import request from '@/utils/aliyunRequest';

const questionApi = {};

questionApi.updateTitle = (params) => {
	return request({
		url: '/aliyun-api/question/update-title',
		method: 'put',
		data: params,
	})
}
questionApi.configOptionShowText = (id, optionId, showText) => {
	return request({
		url: '/aliyun-api/question/config-show-text/' + id + '/' + optionId + '/' + showText,
		method: 'put',
	})
}
questionApi.configBranchQuestions = (id, optionId, params) => {
	return request({
		url: '/aliyun-api/question/config-branch-questions/' + id + '/' + optionId,
		method: 'put',
		data: params,
	})
}
questionApi.configOptions = (id, params) => {
	return request({
		url: '/aliyun-api/question/config-options/' + id,
		method: 'put',
		data: params,
	})
}
questionApi.deleteOptions = (id, params) => {
	return request({
		url: '/aliyun-api/question/delete-options/' + id,
		method: 'put',
		data: params,
	})
}
questionApi.sortOptions = (id, params) => {
	return request({
		url: '/aliyun-api/question/sort-options/' + id,
		method: 'put',
		data: params,
	})
}

questionApi.detail = (id) => {
	return request({
		url: '/aliyun-api/question/options/' + id,
		method: 'get',
	})
}
questionApi.list = () => {
	return request({
		url: '/aliyun-api/question/list',
		method: 'get',
	})
}
questionApi.page = (params) => {
	return request({
		url: '/aliyun-api/question/page',
		method: 'get',
		params: params,
	})
}
questionApi.add = (params) => {
	return request({
		url: '/aliyun-api/question',
		method: 'post',
		data: params,
	})
}
questionApi.update = (params) => {
	return request({
		url: '/aliyun-api/question',
		method: 'put',
		data: params,
	})
}
questionApi.get = (id) => {
	return request({
		url: '/aliyun-api/question/' + id,
		method: 'get',
	})
}
questionApi.delete = (id) => {
	return request({
		url: '/aliyun-api/question/' + id,
		method: 'delete',
	})
}


export default questionApi